{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "pytorchmnist.ipynb",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU",
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "b615fd8cfdd947f390fc8a32258eacff": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_64ce35d6a60c468db992f1da6e6f9951",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_178dcc32c8724c04a6cc010f3a28ed8e",
              "IPY_MODEL_9d5dfe7d56454f0787218d03427bac74"
            ]
          }
        },
        "64ce35d6a60c468db992f1da6e6f9951": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "178dcc32c8724c04a6cc010f3a28ed8e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_42f805b9c02748108ede60fe04c7e042",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 1,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 1,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_ddd2d743a5db40e98ca00c430eaf296f"
          }
        },
        "9d5dfe7d56454f0787218d03427bac74": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_bb23c88138bf47d1872e1f225b7207be",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 9920512/? [00:06&lt;00:00, 1491284.52it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_2d01a22ff894422581e251c7e6e0f4fa"
          }
        },
        "42f805b9c02748108ede60fe04c7e042": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "initial",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "ddd2d743a5db40e98ca00c430eaf296f": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "bb23c88138bf47d1872e1f225b7207be": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "2d01a22ff894422581e251c7e6e0f4fa": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "a1d41440c23a4902946c45a3b953fefe": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_01aef8a75fe744a8bcacb5c14390c45f",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_d7803f6bee404cdda686533eaff7ce86",
              "IPY_MODEL_53433a99408440e19fb223eeb51f5e5e"
            ]
          }
        },
        "01aef8a75fe744a8bcacb5c14390c45f": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "d7803f6bee404cdda686533eaff7ce86": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_59ea54ca7ded407895bf298332e06dae",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 1,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 1,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_dc34c877980f42019a720229a4fad424"
          }
        },
        "53433a99408440e19fb223eeb51f5e5e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_3507b550455141c7a10fb1ae39d455e7",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 32768/? [00:03&lt;00:00, 9938.09it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_451bef7227a6481b9c334272751201a0"
          }
        },
        "59ea54ca7ded407895bf298332e06dae": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "initial",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "dc34c877980f42019a720229a4fad424": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "3507b550455141c7a10fb1ae39d455e7": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "451bef7227a6481b9c334272751201a0": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "4cb28ad8ef5d4ab8ac2e55443ff07a06": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_a3eff589a48645f6a28989bb2feb6556",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_db26281868eb4934807a65eb60f82326",
              "IPY_MODEL_8350d26a044244bba4825f4f52ad7129"
            ]
          }
        },
        "a3eff589a48645f6a28989bb2feb6556": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "db26281868eb4934807a65eb60f82326": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_27a32eec0f9e4dbea619bc8319e662c6",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 1,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 1,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_f0b247487fb0434797665fe50f0412d2"
          }
        },
        "8350d26a044244bba4825f4f52ad7129": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_0a629f4f36f34837a3dfbe8c4ead6220",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 1654784/? [00:02&lt;00:00, 683342.41it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_e5984ed04b9240ccb2f15e98b167a4be"
          }
        },
        "27a32eec0f9e4dbea619bc8319e662c6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "initial",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "f0b247487fb0434797665fe50f0412d2": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "0a629f4f36f34837a3dfbe8c4ead6220": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "e5984ed04b9240ccb2f15e98b167a4be": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "49494fbf1f2a4767ae4ab2f15ce89ff3": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_27a0d480ad4249daa59b9d721701cdae",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_28838b5b7c414021a9c4528b87654f8e",
              "IPY_MODEL_efbebfa009d549d98d570639b1355cb6"
            ]
          }
        },
        "27a0d480ad4249daa59b9d721701cdae": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "28838b5b7c414021a9c4528b87654f8e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_e0e450a4f0a4440f9743cacfb52b7e3b",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 1,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 1,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_cfb3e93d04f241cebec2a9ef630a4cd1"
          }
        },
        "efbebfa009d549d98d570639b1355cb6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_754e79c891b04cc98760367ace079509",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 8192/? [00:00&lt;00:00, 12766.74it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_1bb972d450ec4838b5e8e5c6ddee939c"
          }
        },
        "e0e450a4f0a4440f9743cacfb52b7e3b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "initial",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "cfb3e93d04f241cebec2a9ef630a4cd1": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "754e79c891b04cc98760367ace079509": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "1bb972d450ec4838b5e8e5c6ddee939c": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        }
      }
    }
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "id": "T0Pyt14tLFyg",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import torch  \n",
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "%matplotlib inline\n",
        "\n",
        "plt.rcParams['font.sans-serif'] = ['SimHei']\n",
        "plt.rcParams['axes.unicode_minus'] = False"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "wZ3OJ6xbLbXX",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "from torchvision import datasets\n",
        "import torchvision.transforms as transforms\n",
        "from torch.utils.data.sampler import SubsetRandomSampler"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "rM3yZGuoMEU5",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 371,
          "referenced_widgets": [
            "b615fd8cfdd947f390fc8a32258eacff",
            "64ce35d6a60c468db992f1da6e6f9951",
            "178dcc32c8724c04a6cc010f3a28ed8e",
            "9d5dfe7d56454f0787218d03427bac74",
            "42f805b9c02748108ede60fe04c7e042",
            "ddd2d743a5db40e98ca00c430eaf296f",
            "bb23c88138bf47d1872e1f225b7207be",
            "2d01a22ff894422581e251c7e6e0f4fa",
            "a1d41440c23a4902946c45a3b953fefe",
            "01aef8a75fe744a8bcacb5c14390c45f",
            "d7803f6bee404cdda686533eaff7ce86",
            "53433a99408440e19fb223eeb51f5e5e",
            "59ea54ca7ded407895bf298332e06dae",
            "dc34c877980f42019a720229a4fad424",
            "3507b550455141c7a10fb1ae39d455e7",
            "451bef7227a6481b9c334272751201a0",
            "4cb28ad8ef5d4ab8ac2e55443ff07a06",
            "a3eff589a48645f6a28989bb2feb6556",
            "db26281868eb4934807a65eb60f82326",
            "8350d26a044244bba4825f4f52ad7129",
            "27a32eec0f9e4dbea619bc8319e662c6",
            "f0b247487fb0434797665fe50f0412d2",
            "0a629f4f36f34837a3dfbe8c4ead6220",
            "e5984ed04b9240ccb2f15e98b167a4be",
            "49494fbf1f2a4767ae4ab2f15ce89ff3",
            "27a0d480ad4249daa59b9d721701cdae",
            "28838b5b7c414021a9c4528b87654f8e",
            "efbebfa009d549d98d570639b1355cb6",
            "e0e450a4f0a4440f9743cacfb52b7e3b",
            "cfb3e93d04f241cebec2a9ef630a4cd1",
            "754e79c891b04cc98760367ace079509",
            "1bb972d450ec4838b5e8e5c6ddee939c"
          ]
        },
        "outputId": "3ba1e3d0-6b38-4968-f4f8-52793caac6d2"
      },
      "source": [
        "num_workers = 0\n",
        "\n",
        "batch_size = 20\n",
        "valid_size = 0.2\n",
        "transform = transforms.ToTensor()\n",
        "\n",
        "train_data = datasets.MNIST(root='data', train=True, download=True, transform=transform)\n",
        "\n",
        "test_data = datasets.MNIST(root='data', train=False, download=True, transform=transform)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to data/MNIST/raw/train-images-idx3-ubyte.gz\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "b615fd8cfdd947f390fc8a32258eacff",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "Extracting data/MNIST/raw/train-images-idx3-ubyte.gz to data/MNIST/raw\n",
            "Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to data/MNIST/raw/train-labels-idx1-ubyte.gz\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "a1d41440c23a4902946c45a3b953fefe",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "Extracting data/MNIST/raw/train-labels-idx1-ubyte.gz to data/MNIST/raw\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to data/MNIST/raw/t10k-images-idx3-ubyte.gz\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "4cb28ad8ef5d4ab8ac2e55443ff07a06",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "Extracting data/MNIST/raw/t10k-images-idx3-ubyte.gz to data/MNIST/raw\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to data/MNIST/raw/t10k-labels-idx1-ubyte.gz\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "49494fbf1f2a4767ae4ab2f15ce89ff3",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "Extracting data/MNIST/raw/t10k-labels-idx1-ubyte.gz to data/MNIST/raw\n",
            "Processing...\n",
            "Done!\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "stream",
          "text": [
            "/pytorch/torch/csrc/utils/tensor_numpy.cpp:141: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program.\n"
          ],
          "name": "stderr"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "aTzjZZtHNahn",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "num_train = len(train_data)\n",
        "indices = list(range(num_train))\n",
        "np.random.shuffle(indices)\n",
        "split = int(np.floor(valid_size*num_train))\n",
        "train_idx, valid_idx = indices[split:], indices[:split]\n",
        "train_sampler, valid_sampler = SubsetRandomSampler(train_idx), SubsetRandomSampler(valid_idx)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "G5Q84LiLOTGc",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "train_loader = torch.utils.data.DataLoader(train_data, batch_size=batch_size, \n",
        "                                           sampler=train_sampler, num_workers=num_workers)\n",
        "valid_loader = torch.utils.data.DataLoader(train_data, batch_size=batch_size,\n",
        "                                           sampler=valid_sampler, num_workers=num_workers)\n",
        "test_loader = torch.utils.data.DataLoader(test_data, batch_size=batch_size,\n",
        "                                           num_workers=num_workers)\n"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "zRAV5EurO3q_",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 265
        },
        "outputId": "6499eeab-74ed-4c50-fe08-06109f3d2e9d"
      },
      "source": [
        "dataiter = iter(train_loader)\n",
        "images, labels = dataiter.next()\n",
        "images = images.numpy()\n",
        "\n",
        "fig = plt.figure(figsize=(25, 4))\n",
        "for idx in np.arange(20):\n",
        "  ax = fig.add_subplot(2, 20/2, idx+1, xticks=[], yticks=[])\n",
        "  ax.imshow(np.squeeze(images[idx]), cmap='gray')\n",
        "  ax.set_title(str(labels[idx].item()))"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "\n",
            "\n",
            "\n",
            "\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "stream",
          "text": [
            "findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.\n"
          ],
          "name": "stderr"
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAABXEAAAD7CAYAAAAsAtcsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd7hU1dXH8bWl9yIIFkosiIBKi4AISsCCoUpVikYBAaN0AoiK0kRpsRLsIkoTiK8oSlGRqkAEwaCCSkdK6L2c949LdvbeMuPcYc6cM/d+P8/j8/y2a8p633s8M7MzZ43yPE8AAAAAAAAAAOF0QdANAAAAAAAAAAAiYxMXAAAAAAAAAEKMTVwAAAAAAAAACDE2cQEAAAAAAAAgxNjEBQAAAAAAAIAQYxMXAAAAAAAAAEKMTVwAAAAAAAAACLFMs4mrlHpHKbVdKXVAKfWDUqpD0D0h3JRSf1VKLVdKHVdKvRl0P0gdSqlrlFLzlVL7lVLrlVJNg+4J4aaUOuT8c1op9XzQfSH8ON8gvXh/g/RSSuVQSr2mlNqolDqolPpGKVU/6L4Qfkqp0kqpj5RSe5VSO5RSLyilsgbdF1KDUuoqpdQxpdQ7QfeC8FNKFVZKzVBKHT77enVP0D35IdNs4orIcBEp7XlefhFpJCJDlFJVAu4J4bZNRIaIyOtBN4LUc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AAAAAAhxiYuAAAAAAAAAIRYhhyn4KpWrVrEWoECBaz1J598ovMf//jHuJ7vH//4h7U2vxZujnZAcuTLl0/nnj17WjXzUmXzMmURLk3O6I4dO6azecnyudbxePjhh621OT5BROT//u//dH7hhResWrRLEZH63EvBli5dqnOxYsWi3nfChAk6u8cYUt9rr71mrcuUKaNzixYtrFq85wnzGBIR2b59e1yPg/CoXr26tZ48ebLO7qXu5vnHrbnjPBBeBw8e1Llo0aIx32/u3LnnzC53/NgVV1yh8+WXXx7z87nee++9uO+LcHCPN/M9s3tO2bx5s87mJdQiIqVKlbLWVapU0dkcu4Fwc0dVxsrcc4mmf//+1nro0KHW2hzn4N7WHJ2H4FSqVClirXv37kns5Pflzp1b5/z581u1RYsW6Rz0e2e+iQsAAAAAAAAAIcYmLgAAAAAAAACEGJu4AAAAAAAAABBigczELVu2rM633HJLzPc7fvy4zm+88UZCetm/f7+1Nvu54447rNqkSZN0zpYtW8THdGcFde7cWecuXbrE0ybOwwcffKBzrVq1It7OnYHbrVs333pCxnTllVfq7M5fPnDggLUePny4zuZ8XmRMl1xyic7mvEoRkeLFi0e8n/saNXHixMQ2hlAxZ+iLiLRq1UrnadOmWbWCBQvqfP/991u1aL8F8P77759HhwijHj16WGtzXrI7O/nMmTM6m/O4z7VGeG3dulXnZcuWWTVzBv/GjRutmjlb231fYnr22Wettfke+Xxm4prvfbJkyWLVEvXZDv5q2rSptb766qt1ds83VatW1bljx45WbciQIda6Q4cOOjMTF7Ey92eYgRtO5u87uI4ePZrETn6fuf9jzoIX+e05K0h8ExcAAAAAAAAAQoxNXAAAAAAAAAAIsUDGKcycOVPnq666Kub7mZeAPfroozHf78cff9T51Vdfjfl+rtOnT+scbZyCy7zshHEK/rv55puttTkiwzyGRES2bdum8+uvv+5rX8h4SpYsaa1Hjx6tc6lSpayaOVZFhMtWM7rs2bNba/PcX7NmTatmXn7ojtZo3ry5tZ43b16iWkSKmTp1qrXOlSuXzg899JBVcy9pVUrp/PPPP/vQHZKtevXqOruXkJrnDfNvLyJywQX/+/6G+R5IxL5EH6lj0aJF1rphw4Y6u68p0UYomB5++GFr3b59e53dY8pdb9iwQee//OUvVs0cmfDaa69ZNXO0kDl2AeHijg00//5ffvmlVdu9e7fO69ati3g/IJLKlStHrbujppBa8ubNG+jzFylSxFq3bt1a59mzZ1u1KVOmJKWnWPBNXAAAAAAAAAAIMTZxAQAAAAAAACDE2MQFAAAAAAAAgBALZCZu4cKF47qfOcfrD3/4Q8z3M2972223xfXc54P5c/6rX7++zu+9955VM+fgbtq0yaq1aNFC51WrVvnUHTKq++67z1o3aNBAZ3Pum4jIK6+8koyWEBLujNIBAwbo7M4rPXjwoM7mOUmEGbiIrEyZMjpfe+21UW87f/58nffs2eNbT0ie7t276+yeN8z3PeZ7ZxGRUaNG6dy3b1+fukMyue9fjx8/rrP7matcuXI679y506q1adNG56eeesqq5ciRQ2f3NcycgStivydfv359xNqMGTOs2sCBA3XOmtX+iDpixAidT5w4IQhOkyZNrLV5PPz73/+OeD/37+0eR9dcc00CukNGkDNnTp2vu+46q7Z//35rPWfOnKT0hPh9+OGH1rpTp046/+1vf7Nq9957r84nT55MyPObx5OIyO23367zmDFjrJr5GwO9e/e2akePHk1IP4nAN3EBAAAAAAAAIMTYxAUAAAAAAACAEAtknML333+vc9WqVa1a9uzZk91OwpmXMYnYlwDBH+Zl7Xnz5o14u6VLl1rr5cuX+9USMqh69erp3LVrV6v29ddf69yzZ0+r5l42hoznlltu0blLly5WTSkV8X7ly5fXeevWrQnvCxlTesZKPfHEEzqfOnXKj3bgs+rVq1vrGjVq6OyeX8wRCsuWLbNqzz33nA/dIUiffPKJtZ49e7bOjRo1smrffvutzu5xE+v7lLlz51rrjh07Wmt3dJnJHK/gjoH59NNPdR40aJBVK1KkiM7dunWLqU/4Y926ddba/SwfSdOmTa21e/xFG8WAzMU8b1111VVWbeLEidb6yJEjSekJ8fv444+t9aJFi3Ru3bq1VTNHKLz55ptWzRwd5I7VMfcQe/XqZdUaNmx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x48fj/n5s2TJYq1Lly4d8bbfffedznfccYdV27p1a8zPieCsWrXKWn/66ac633bbbVatVq1aOlesWNGqLV++3IfukJG4c6Fc1atXP2cWSd/cKKSGHDly6OzO5t6wYYPOkydPTlpPSJ758+frfOzYMaumlNLZnEkoIvL444/r7M6WNLmz+Nu1axdXn8h4Tp8+ba2PHDmic+7cua3av/71r6T0hOCY89lz5sxp1S688EKd7777bqtmzq91Z3V37tzZWptzvs3XN5Hfzn1HcIoUnPuLhAAABFFJREFUKWKt//rXv+oc6wxcEftz95w5c86/MYRayZIlrbU5LzdRpk2bFtf9pkyZkuBOECYdO3bU2Z33P3bsWJ1PnTqVtJ6CwjdxAQAAAAAAACDE2MQFAAAAAAAAgBALfJyC+3Xn4cOH67x7926r1qdPH51LlSpl1S677LK4nt+8jFHEvlyxZ8+eVu2dd97Rec+ePXE9H4LlXlb4+eef63z77bdHrK1cudLPtpABbd682Vq755MePXrozDiWjK9BgwY6u5eivfjiizofPXo0aT0heQ4ePKhzly5drNobb7yhs3kZsivaOIUPP/zwPLpDRrZ3715rPX78eJ3bt29v1cxL5pExmaOe3nzzTatmjmExP/OI2J/JihYtatXcc9POnTt1vvXWW63axo0b09cwfOO+9zRHbUSzYMECa21+dl+/fv35N4aUwggD+KVmzZrWulWrVjrPnTvXqn355ZdJ6Sks+CYuAAAAAAAAAIQYm7gAAAAAAAAAEGJs4gIAAAAAAABAiKloM9Z+c2OlYr+xD3LmzKlzmTJlrFqLFi10vv76661aoUKFIj7mvHnzrPWzzz6r84kTJ6zayZMnY2/Wfys8z6sadBOxCPq4wf94nqd+/1bB45gJFc41CdC3b1+dBwwYYNV69eql82uvvZa0nnzGcRMjcyauOZNSxJ7b775fe/nll3U2jyGR375/SSEcN4gHx00C1K5dW+dKlSpZtSpVquj8hz/8war9/PPP1nr06NE6f/PNN4lsMdEy9XHjfgZ250+azLm3o0aNsmqHDh1KbGPhl6mPG8SHz+CxyZr1fz/Z5c7frl69us7m3p+IyPvvv+9vY8GIeK7hm7gAAAAAAAAAEGJs4gIAAAAAAABAiKXUOAVYuJQD6calHIgD55oEGD9+vM5FihSxanfddVey20kGjpsY5c6dW2dz7IaISN68eXXevn27VXv++ed1TuHxCS6OG8SD4wbx4LhBPDhukG58Bo9NgQIFdN67d69VW7Fihc7VqlWzamfOnPG3sWAwTgEAAAAAAAAAUhGbuAAAAAAAAAAQYmziAgAAAAAAAECIZQ26AQAAMrpOnToF3QJC6siRIzoPGjQouEYAAACAgBw7dkznr7/+2qr9+9//1jmDzsCNGd/EBQAAAAAAAIAQYxMXAAAAAAAAAEKMcQoAAAAAAAAAAnH8+HGdq1WrFmAn4cY3cQEAAAAAAAAgxNjEBQAAAAAAAIAQYxMXAAAAAAAAAEIsvTNxd4vIRj8aQbqVCrqBdOC4CQeOGcSD4wbx4LhBPDhuEA+OG8SD4wbx4LhBenHMIB4RjxvleV4yGwEAAAAAAAAApAPjFAAAAAAAAAAgxNjEBQAAAAAAAIAQYxMXAAAAAAAAAEKMTVwAAAAAAAAACDE2cQEAAAAAAAAgxNjEBQAAAAAAAIAQYxMXAAAAAAAAAEKMTVwAAAAAAAAACDE2cQEAAAAAAAAgxP4fAGTI8M5a9zEAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 1800x288 with 20 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "M4FsMYXdQqCC",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 129
        },
        "outputId": "4d20236a-aa02-49ee-eaf3-fb7f53abae24"
      },
      "source": [
        "import torch.nn as nn\n",
        "import torch.nn.functional as F\n",
        "\n",
        "class Net(nn.Module):\n",
        "  def __init__(self):\n",
        "    super(Net, self).__init__()\n",
        "    hidden1 = 256\n",
        "    hidden2 = 256\n",
        "    self.fc1 = nn.Linear(28 * 28, hidden1)\n",
        "    self.fc2 = nn.Linear(hidden1, hidden2)\n",
        "    self.fc3 = nn.Linear(hidden2, 10)\n",
        "    self.dropout = nn.Dropout(0.2)\n",
        "\n",
        "  def forward(self, x):\n",
        "    x = x.view(-1, 28*28)\n",
        "    x = F.relu(self.fc1(x))\n",
        "    x = self.dropout(x)\n",
        "    \n",
        "    x = F.relu(self.fc2(x))\n",
        "    x = self.dropout(x)\n",
        "\n",
        "    x = self.fc3(x)\n",
        "    return(x)\n",
        "\n",
        "model = Net()\n",
        "print(model)\n"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Net(\n",
            "  (fc1): Linear(in_features=784, out_features=256, bias=True)\n",
            "  (fc2): Linear(in_features=256, out_features=256, bias=True)\n",
            "  (fc3): Linear(in_features=256, out_features=10, bias=True)\n",
            "  (dropout): Dropout(p=0.2, inplace=False)\n",
            ")\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "YaMwo_xeQz5_",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "criterion = nn.CrossEntropyLoss()\n",
        "optimizer = torch.optim.SGD(model.parameters(), lr=0.01)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "FKrk_YpIXTc3",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "ef27419b-d059-46d0-e226-ea1aad6a9df9"
      },
      "source": [
        "len(train_loader.dataset)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "60000"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 129
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0BrqHTgtXgYe",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "outputId": "b1a1d0b3-075a-498b-fed3-37c277ad2c9c"
      },
      "source": [
        "\n",
        "train_loss_lst = []\n",
        "val_loss_lst = []\n",
        "def train(model):\n",
        "  n_epochs = 50\n",
        "  valid_loss_min = np.Inf\n",
        "  for epoch in range(n_epochs):\n",
        "    train_loss = 0.0\n",
        "    valid_loss = 0.0\n",
        "\n",
        "    model.train()\n",
        "\n",
        "    for data, target in train_loader:\n",
        "      optimizer.zero_grad()\n",
        "      output = model(data)\n",
        "      loss = criterion(output, target)\n",
        "      loss.backward()\n",
        "      optimizer.step()\n",
        "      train_loss += loss.item() * data.size(0)\n",
        "    \n",
        "    model.eval()\n",
        "    for data, target in valid_loader:\n",
        "      output = model(data)\n",
        "      loss = criterion(output, target)\n",
        "      valid_loss += loss.item() * data.size(0)\n",
        "      \n",
        "    train_loss = train_loss / len(train_loader.dataset)\n",
        "    valid_loss = valid_loss / len(valid_loader.dataset)\n",
        "    train_loss_lst.append(train_loss)\n",
        "    val_loss_lst.append(valid_loss)\n",
        "    print('epoch {}, train loss {:.6f}, valid loss {:.6f}'.format(epoch+1, train_loss, valid_loss))\n",
        "    \n",
        "    if valid_loss <= valid_loss_min:\n",
        "      print('valid loss has decreased {:.6f} --> {:.6f}. Save the model'.format(\n",
        "          valid_loss_min, valid_loss))\n",
        "      torch.save(model.state_dict(), 'model.pt')\n",
        "      valid_loss_min = valid_loss\n",
        "train(model)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "epoch 1, train loss 0.825784, valid loss 0.079941\n",
            "valid loss has decreased inf --> 0.079941. Save the model\n",
            "epoch 2, train loss 0.306139, valid loss 0.059168\n",
            "valid loss has decreased 0.079941 --> 0.059168. Save the model\n",
            "epoch 3, train loss 0.240309, valid loss 0.048425\n",
            "valid loss has decreased 0.059168 --> 0.048425. Save the model\n",
            "epoch 4, train loss 0.202042, valid loss 0.041194\n",
            "valid loss has decreased 0.048425 --> 0.041194. Save the model\n",
            "epoch 5, train loss 0.170719, valid loss 0.035767\n",
            "valid loss has decreased 0.041194 --> 0.035767. Save the model\n",
            "epoch 6, train loss 0.149778, valid loss 0.032584\n",
            "valid loss has decreased 0.035767 --> 0.032584. Save the model\n",
            "epoch 7, train loss 0.132910, valid loss 0.029195\n",
            "valid loss has decreased 0.032584 --> 0.029195. Save the model\n",
            "epoch 8, train loss 0.119960, valid loss 0.026523\n",
            "valid loss has decreased 0.029195 --> 0.026523. Save the model\n",
            "epoch 9, train loss 0.108889, valid loss 0.024982\n",
            "valid loss has decreased 0.026523 --> 0.024982. Save the model\n",
            "epoch 10, train loss 0.099409, valid loss 0.023461\n",
            "valid loss has decreased 0.024982 --> 0.023461. Save the model\n",
            "epoch 11, train loss 0.092645, valid loss 0.021556\n",
            "valid loss has decreased 0.023461 --> 0.021556. Save the model\n",
            "epoch 12, train loss 0.085062, valid loss 0.020883\n",
            "valid loss has decreased 0.021556 --> 0.020883. Save the model\n",
            "epoch 13, train loss 0.079666, valid loss 0.019768\n",
            "valid loss has decreased 0.020883 --> 0.019768. Save the model\n",
            "epoch 14, train loss 0.075304, valid loss 0.019323\n",
            "valid loss has decreased 0.019768 --> 0.019323. Save the model\n",
            "epoch 15, train loss 0.068870, valid loss 0.018234\n",
            "valid loss has decreased 0.019323 --> 0.018234. Save the model\n",
            "epoch 16, train loss 0.066540, valid loss 0.018100\n",
            "valid loss has decreased 0.018234 --> 0.018100. Save the model\n",
            "epoch 17, train loss 0.062798, valid loss 0.017360\n",
            "valid loss has decreased 0.018100 --> 0.017360. Save the model\n",
            "epoch 18, train loss 0.058156, valid loss 0.016564\n",
            "valid loss has decreased 0.017360 --> 0.016564. Save the model\n",
            "epoch 19, train loss 0.056216, valid loss 0.016387\n",
            "valid loss has decreased 0.016564 --> 0.016387. Save the model\n",
            "epoch 20, train loss 0.053604, valid loss 0.015609\n",
            "valid loss has decreased 0.016387 --> 0.015609. Save the model\n",
            "epoch 21, train loss 0.050528, valid loss 0.015608\n",
            "valid loss has decreased 0.015609 --> 0.015608. Save the model\n",
            "epoch 22, train loss 0.047748, valid loss 0.015485\n",
            "valid loss has decreased 0.015608 --> 0.015485. Save the model\n",
            "epoch 23, train loss 0.044413, valid loss 0.014957\n",
            "valid loss has decreased 0.015485 --> 0.014957. Save the model\n",
            "epoch 24, train loss 0.043657, valid loss 0.014943\n",
            "valid loss has decreased 0.014957 --> 0.014943. Save the model\n",
            "epoch 25, train loss 0.041378, valid loss 0.014633\n",
            "valid loss has decreased 0.014943 --> 0.014633. Save the model\n",
            "epoch 26, train loss 0.040751, valid loss 0.014499\n",
            "valid loss has decreased 0.014633 --> 0.014499. Save the model\n",
            "epoch 27, train loss 0.038220, valid loss 0.014504\n",
            "epoch 28, train loss 0.036745, valid loss 0.014076\n",
            "valid loss has decreased 0.014499 --> 0.014076. Save the model\n",
            "epoch 29, train loss 0.035630, valid loss 0.013797\n",
            "valid loss has decreased 0.014076 --> 0.013797. Save the model\n",
            "epoch 30, train loss 0.034244, valid loss 0.013897\n",
            "epoch 31, train loss 0.032785, valid loss 0.013923\n",
            "epoch 32, train loss 0.031566, valid loss 0.013568\n",
            "valid loss has decreased 0.013797 --> 0.013568. Save the model\n",
            "epoch 33, train loss 0.029098, valid loss 0.013581\n",
            "epoch 34, train loss 0.029427, valid loss 0.013450\n",
            "valid loss has decreased 0.013568 --> 0.013450. Save the model\n",
            "epoch 35, train loss 0.027521, valid loss 0.013504\n",
            "epoch 36, train loss 0.026570, valid loss 0.013468\n",
            "epoch 37, train loss 0.025878, valid loss 0.013638\n",
            "epoch 38, train loss 0.025056, valid loss 0.013422\n",
            "valid loss has decreased 0.013450 --> 0.013422. Save the model\n",
            "epoch 39, train loss 0.023960, valid loss 0.013251\n",
            "valid loss has decreased 0.013422 --> 0.013251. Save the model\n",
            "epoch 40, train loss 0.022782, valid loss 0.013499\n",
            "epoch 41, train loss 0.022379, valid loss 0.013050\n",
            "valid loss has decreased 0.013251 --> 0.013050. Save the model\n",
            "epoch 42, train loss 0.021969, valid loss 0.013355\n",
            "epoch 43, train loss 0.021344, valid loss 0.013217\n",
            "epoch 44, train loss 0.020000, valid loss 0.013209\n",
            "epoch 45, train loss 0.019165, valid loss 0.013245\n",
            "epoch 46, train loss 0.019074, valid loss 0.013050\n",
            "valid loss has decreased 0.013050 --> 0.013050. Save the model\n",
            "epoch 47, train loss 0.018999, valid loss 0.013142\n",
            "epoch 48, train loss 0.018388, valid loss 0.013286\n",
            "epoch 49, train loss 0.017650, valid loss 0.013220\n",
            "epoch 50, train loss 0.016540, valid loss 0.013218\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "7LYpl4SaYHAa",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 265
        },
        "outputId": "c79539ce-6b98-4180-d8a1-9e7b616b2637"
      },
      "source": [
        "plt.plot(train_loss_lst, label='train error')\n",
        "plt.plot(val_loss_lst, label='valid error')\n",
        "plt.legend()\n",
        "plt.show()"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3de5xV5X3v8c9v3+fKdbgOBIygoCDCyCHBRJOUijHBpN6wuZiTtpz0aNS0TUKa1FrPq6/YNieNSYmtJtrGJiGGxEhOSY0xWmvVhkGJ4SIREGFAYEAuM8x1z/6dP9aeYc8wMBtmD5u99/f9eu3XXpdn1nrWMHzX2s969nrM3RERkcIXyncFREQkNxToIiJFQoEuIlIkFOgiIkVCgS4iUiQi+drx6NGjfcqUKfnavYhIQVq3bt0Bd6/pb13eAn3KlCnU19fna/ciIgXJzN442To1uYiIFAkFuohIkVCgi4gUiby1oYtIcejs7KShoYG2trZ8V6WoJBIJamtriUajWf+MAl1EBqWhoYGqqiqmTJmCmeW7OkXB3Tl48CANDQ1MnTo1659Tk4uIDE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sn5mNB0i/789zfYaEmUUJwvy77v7j9OKSOHYAdz8MPA28AxieHgUMivPvfSGwxMx2EDShvhe4j+I/btx9d/p9P8EJfD6D/DsvtEDPZvSkYpY5MtQtwON5rMuQSLeffhvY7O5fzVhV1MduZjXpK3PMrAxYRHD/4GmCUcCgCI/b3b/g7rXuPoXg//Mv3f0jFPlxm1mFmVV1TwO/C2xgkH/nBfdNUTN7P0GbW/foSX+d5yoNCTP7PnAlweM09wF/CfwEeBSYTPDo4Rvdve+N04JmZpcD/wn8huNtqn9O0I5etMduZrMJboKFCS60HnX3e8zsPIIr15HAy8BH3b09fzUdOukmlz9z9w8U+3Gnj++x9GwE+J67/7WZjWIQf+cFF+giItK/QmtyERGRk1Cgi4gUCQW6iEiRUKCLiBQJBbqISJFQoIuIFAkFuohIkfj/LvkUHIzMuGkAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tkbVe0OSqUxk",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 265
        },
        "outputId": "97e29bdd-e2a2-4f20-e9c3-3a571281bd2d"
      },
      "source": [
        "plt.plot(val_loss_lst, label='valid error', c='r')\n",
        "plt.show()"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAeDUlEQVR4nO3df5QddX3/8ecrWTaJJCQkLD9CAgkQpCsixDViAQVSlEC/Bv1CCYKmNIqoeGzBH9Ee0cbWnlgLtkdazZFoDr8CRfGbSi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y1GXzbxR/uwGIiLXZ60uknfs0evG7XpSgr2Q8niIrHWtoNvD/cqylT2T9s1cDj0bEFSWrCr3tkhqyI3kkjQBOI52fuIs0rhQUcLsj4ssRMSG7s34Wafys8yn4dgNI2lvSqI554P3Aw/Tid70wd8ZKOoPUp9cxHs8/5VxSn5B0A3AyadjSF4GvAT8FbgIOAZ4G/ioiyk/YDmqSTgTuAVays8/2K6R++sJuu6RjSCfehpIOzG6KiHmSDiMd6Y4FHgAuiIht+VXad7Kum89HxF/WwnZn23hL9rYOuD4i/knSOHr4u16YoDczs84VpevGzMx2w0FvZlZwDnozs4Jz0JuZFZyD3sys4Bz0ZmYF56A3Myu4/w+4O2n07x1IQAAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "9ZAgQ0thqgDt",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "bd7ec787-9b1c-407e-8179-69b826b781f3"
      },
      "source": [
        "model.load_state_dict(torch.load('model.pt'))"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "<All keys matched successfully>"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 133
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "NzsdbbKsqo_S",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "test_loss = 0.0\n",
        "class_correct = list(0. for i in range(10))\n",
        "class_total = list(0. for i in range(10))"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "8UE6BjqHq-he",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "dataiter = iter(train_loader)\n",
        "data, target = dataiter.next()"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "B_Uno4BDrJYY",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "9b4de448-86e1-4738-f993-53f65f4728c3"
      },
      "source": [
        "data.shape"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "torch.Size([20, 1, 28, 28])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 136
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "dhmNVC3wrKlH",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "8b4c35cd-af4d-496c-992b-e52d4ec824f9"
      },
      "source": [
        "target.shape"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "torch.Size([20])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 137
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "DZ_bouRXrLoj",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "dcfd53e6-fde2-4e82-e317-694710373315"
      },
      "source": [
        "target"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([4, 3, 5, 2, 5, 2, 0, 3, 4, 3, 9, 3, 9, 8, 0, 9, 9, 8, 3, 1])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 138
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "e2-a-wXMrMfU",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 129
        },
        "outputId": "a227c602-0f9f-4516-96e3-51445dc93958"
      },
      "source": [
        "model.eval()"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "Net(\n",
              "  (fc1): Linear(in_features=784, out_features=256, bias=True)\n",
              "  (fc2): Linear(in_features=256, out_features=256, bias=True)\n",
              "  (fc3): Linear(in_features=256, out_features=10, bias=True)\n",
              "  (dropout): Dropout(p=0.2, inplace=False)\n",
              ")"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 139
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "e6V5DaImrN-M",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "cf2b8915-d213-4a42-c47f-57e0a97b24ab"
      },
      "source": [
        "output = model(data)\n",
        "output.shape"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "torch.Size([20, 10])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 140
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "KIQHqq4PrX_2",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 55
        },
        "outputId": "9288ed44-fce1-463d-ac7c-e3dbc4dcbffd"
      },
      "source": [
        "output[0]"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([-7.2914, -2.1485, -5.7419, -6.3471, 18.9975, -0.9429, -4.1152,  0.5470,\n",
              "         1.3088,  6.5260], grad_fn=<SelectBackward>)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 141
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "8QGb2VPnraPW",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "6ba866eb-e97f-447e-c097-418d215dda7c"
      },
      "source": [
        "loss = criterion(output, target)\n",
        "loss"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor(0.0006, grad_fn=<NllLossBackward>)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 142
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "nTg156IgreFU",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "9eb6023a-9b94-482a-b5a9-e27d47d1fa61"
      },
      "source": [
        "test_loss += loss.item()*data.size(0)\n",
        "test_loss"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "0.011584720341488719"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 143
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Hewj14aErk66",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "02690d3d-7556-49c0-dfd1-84ce4b26a605"
      },
      "source": [
        "_, pred = torch.max(output, 1)\n",
        "pred"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([4, 3, 5, 2, 5, 2, 0, 3, 4, 3, 9, 3, 9, 8, 0, 9, 9, 8, 3, 1])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 144
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "mIWdwwMGsMNP",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "bc0f8b43-a31f-41ad-976e-3895d4e07680"
      },
      "source": [
        "target"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([4, 3, 5, 2, 5, 2, 0, 3, 4, 3, 9, 3, 9, 8, 0, 9, 9, 8, 3, 1])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 145
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "yoW9UfcAsNtr",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 55
        },
        "outputId": "645884a7-daab-46e3-ea00-2214ce70e880"
      },
      "source": [
        "correct = np.squeeze(pred.eq(target.data.view_as(pred)))\n",
        "correct"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([True, True, True, True, True, True, True, True, True, True, True, True,\n",
              "        True, True, True, True, True, True, True, True])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 146
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "8svyhCkGsYdf",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "022e22e8-4466-4cbc-9ef0-5f3bbc1d06a5"
      },
      "source": [
        "model.eval()\n",
        "for data, target in test_loader:\n",
        "  output = model(data)\n",
        "\n",
        "  loss = criterion(output, target)\n",
        "  test_loss += loss.item()*data.size(0)\n",
        "  _, pred = torch.max(output, 1)\n",
        "\n",
        "  correct = np.squeeze(pred.eq(target.data.view_as(pred)))\n",
        "  for i in range(batch_size):\n",
        "    label = target.data[i]\n",
        "    class_correct[label] += correct[i].item()\n",
        "    class_total[label] += 1\n",
        "\n",
        "test_loss = test_loss/len(test_loader.dataset)\n",
        "print('test error: {:.6f}'.format(test_loss))    "
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "test error: 0.061485\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "XWZM1rZBtcsr",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "5de3d6dc-1391-4da9-d894-a87ca426aa02"
      },
      "source": [
        "class_correct"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[972.0, 1126.0, 1015.0, 997.0, 961.0, 870.0, 941.0, 1005.0, 949.0, 984.0]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 148
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "LSYZApOrwbbJ",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "152a19fe-070b-4e6b-8402-0090086ffab0"
      },
      "source": [
        "class_total"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[980.0, 1135.0, 1032.0, 1010.0, 982.0, 892.0, 958.0, 1028.0, 974.0, 1009.0]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 149
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0RzweiNBwevn",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 204
        },
        "outputId": "d9b07833-d8c8-40b2-8b5c-25fea2d0c8cb"
      },
      "source": [
        "for i in range(10):\n",
        "  print('correct rate of Number {} on test set is {:5f}% ({:.0f}/{:.0f})'.\n",
        "        format(i, class_correct[i]*100/class_total[i], class_correct[i], class_total[i]))"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "correct rate of Number 0 on test set is 99.183673% (972/980)\n",
            "correct rate of Number 1 on test set is 99.207048% (1126/1135)\n",
            "correct rate of Number 2 on test set is 98.352713% (1015/1032)\n",
            "correct rate of Number 3 on test set is 98.712871% (997/1010)\n",
            "correct rate of Number 4 on test set is 97.861507% (961/982)\n",
            "correct rate of Number 5 on test set is 97.533632% (870/892)\n",
            "correct rate of Number 6 on test set is 98.225470% (941/958)\n",
            "correct rate of Number 7 on test set is 97.762646% (1005/1028)\n",
            "correct rate of Number 8 on test set is 97.433265% (949/974)\n",
            "correct rate of Number 9 on test set is 97.522299% (984/1009)\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "EtP7LIP5xLCc",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 149
        },
        "outputId": "c3ffe958-1d58-44cc-e72d-f4534f184799"
      },
      "source": [
        "# dataiter = iter(test_loader)\n",
        "images, labels = dataiter.next()\n",
        "output = model(images)\n",
        "_, preds = torch.max(output, 1)\n",
        "images = images.numpy()\n",
        "\n",
        "fig = plt.figure(figsize=(25, 4))\n",
        "for idx in np.arange(20):\n",
        "  if preds[idx]!=labels[idx]:\n",
        "    ax = fig.add_subplot(2, 20/2, idx+1, xticks=[], yticks=[])\n",
        "    ax.imshow(np.squeeze(images[idx]), cmap='gray')\n",
        "    ax.set_title('{} ({})'.format(str(preds[idx].item()), str(labels[idx].item())),\n",
        "               color = \"red\")"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAHQAAACECAYAAABBCA8+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAF1klEQVR4nO2dUUhWZxjH/68YUi2QwBk0JgxbizbWQBc62BiOxdCrvIh0c0GxvKqLLpoSDEG90bsRCkHoLooaeNOVIIi4LhwJJRtzTNisXbQwrBW2xrZnF8rpvCfPl1995/u+8//+P/jged7nff2er3/P+3iO55zPmRkED2WFTkDkFglKhgQlQ4KSIUHJkKBklJagzlXBuXk4t3kDc6vh3E9wriIPmeWMdAvq3MPI618493WGFV8CGIHZo7X1g3DuFzj3YE3ojmCm2R8AJgF8keRHyDlmxvECXjLgoQHvx8QrDFgy4JXQWI8BbxhQZsB+A5YNaAzF3zPgh4J/tixe6a5Qn1YAdwBMx8T3A7gHs9+DEbOvYDYPs/9gNrO2tiG0ZgbAa3CuJqGccw6ToJ8D+Abx5zLfAvBz7OrVvloP4MdgzOwfAAsA3s5ZlgnDIehqBX0AYDTDrEoADzLEhwHcADAeGX+wtjYVlBc6gRzxGYDvYPZrhjnLALatG3FuAMCbAD5cp8K3AbiXiyTzAUeFAh3IXJ0AMAfg9adGnesB8AmAj2H2ZyRWDqAWq5WbCtI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UHJSG0Pra+vj41Fe+atW7cCu6KiwosdPHjQ88+cORPYJ06ceJEUC4IqlAwJSkZqt9yGhobY2Pbt2z0//P0rFy5c8GI1NTWe39fXF9hTU1MvkmJBUIWSIUHJkKBkuGy+P9M5t/HJCXP27FnPP378+IbWRa90OHfunOd3dna+WGL5Y9bM6qKDqlAyJCgZqd1yq6qqPD98W+DevXu9WPi7z8KHJQAwPj7u+dF7X4oYbbmlgAQlQ4KSkdoeKtRDSwIJSoYEJUOCkiFByZCgZGR7xcISgMUkEhFZU7PeYFbHoaL40ZZLhgQlQ4KSIUHJkKBkSFAyJCgZEpQMCUrG/yAOfx5mc17tAAAAAElFTkSuQmCC\n",
            "text/plain": [
              "<Figure size 1800x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "aEvzoy1RyIR8",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "dataiter = iter(test_loader)\n",
        "images, labels = dataiter.next()\n",
        "# output = model(images[0])"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "3WNigRigyrgI",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "nIjKtF9QlJ-z",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 783
        },
        "outputId": "ca0c69a3-4ee8-41d7-e863-498d2d348a5c"
      },
      "source": [
        "F.softmax(output, dim=1)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([[5.1788e-10, 5.2774e-11, 1.1452e-09, 6.2600e-12, 9.9999e-01, 3.5060e-07,\n",
              "         1.7755e-08, 3.7052e-07, 5.7590e-06, 1.6061e-06],\n",
              "        [5.3257e-08, 2.3046e-05, 7.0197e-07, 4.3302e-03, 1.9906e-05, 6.0337e-06,\n",
              "         9.0823e-09, 2.0448e-04, 5.8130e-05, 9.9536e-01],\n",
              "        [1.0314e-09, 9.9945e-01, 2.0867e-05, 1.5131e-06, 2.8253e-05, 4.2835e-10,\n",
              "         2.9727e-07, 4.9014e-04, 7.9587e-06, 3.3917e-09],\n",
              "        [7.6050e-08, 1.0011e-09, 1.0000e+00, 1.1430e-07, 1.7910e-12, 1.9631e-11,\n",
              "         1.9201e-11, 6.1403e-10, 1.7286e-07, 4.3261e-13],\n",
              "        [1.6855e-09, 5.5160e-09, 1.3492e-11, 1.3992e-06, 1.9639e-14, 1.0000e+00,\n",
              "         4.9582e-08, 1.9493e-13, 1.6668e-09, 6.5671e-11],\n",
              "        [2.7275e-07, 1.1291e-08, 8.3732e-11, 1.5102e-06, 1.1321e-09, 9.9995e-01,\n",
              "         3.8836e-05, 1.8007e-11, 9.3911e-07, 7.7507e-06],\n",
              "        [5.0705e-11, 7.0045e-09, 2.5805e-07, 2.5729e-05, 7.2189e-10, 8.5180e-12,\n",
              "         2.6596e-15, 9.9997e-01, 1.8235e-10, 1.3608e-08],\n",
              "        [8.0728e-09, 1.6433e-07, 3.6215e-06, 1.0693e-05, 1.4832e-11, 9.6792e-11,\n",
              "         4.6129e-14, 9.9999e-01, 1.4256e-07, 5.5713e-08],\n",
              "        [1.2299e-09, 9.9995e-01, 1.0295e-06, 8.5076e-08, 4.1074e-07, 1.8735e-08,\n",
              "         4.5305e-06, 1.6128e-05, 2.5944e-05, 3.8292e-09],\n",
              "        [3.9807e-07, 4.6091e-06, 1.0322e-05, 5.4480e-07, 5.4162e-09, 6.5042e-08,\n",
              "         1.5268e-07, 4.6084e-07, 9.9998e-01, 7.6143e-07],\n",
              "        [1.6858e-11, 1.8737e-06, 1.0000e+00, 5.7545e-09, 3.2789e-15, 3.8961e-13,\n",
              "         1.4551e-11, 2.3561e-09, 2.4542e-08, 7.1179e-15],\n",
              "        [7.1302e-08, 1.3397e-04, 9.9965e-01, 1.5784e-04, 2.1370e-10, 5.5665e-10,\n",
              "         1.2992e-08, 2.9866e-05, 2.6913e-05, 2.8865e-10],\n",
              "        [3.2456e-05, 2.8390e-06, 4.6833e-04, 2.2125e-02, 3.2093e-06, 3.4388e-05,\n",
              "         2.5543e-07, 1.2194e-06, 9.7684e-01, 4.9572e-04],\n",
              "        [1.0000e+00, 4.9962e-12, 2.0041e-08, 1.0914e-11, 3.4925e-14, 2.9211e-08,\n",
              "         7.3062e-08, 8.4149e-11, 7.6966e-12, 7.4738e-12],\n",
              "        [4.6542e-08, 7.3052e-04, 2.5610e-07, 4.9614e-06, 9.9722e-01, 2.4533e-05,\n",
              "         1.7007e-06, 4.0083e-05, 9.3901e-04, 1.0352e-03],\n",
              "        [5.8119e-09, 9.9987e-01, 2.6388e-06, 5.4678e-07, 1.1909e-06, 1.8470e-07,\n",
              "         3.3784e-05, 1.5403e-05, 7.1638e-05, 1.4879e-08],\n",
              "        [1.0000e+00, 2.4133e-14, 2.1586e-08, 1.5650e-12, 2.9568e-16, 9.8792e-11,\n",
              "         8.4140e-09, 4.0753e-14, 1.0913e-13, 7.9435e-15],\n",
              "        [3.7286e-08, 9.9582e-01, 8.4930e-06, 3.5257e-06, 2.0623e-05, 1.0492e-08,\n",
              "         3.0695e-07, 4.1411e-03, 3.2154e-06, 2.6952e-07],\n",
              "        [6.8029e-07, 4.5471e-06, 1.3960e-05, 1.5551e-01, 1.5171e-09, 8.4430e-01,\n",
              "         1.3070e-07, 8.6487e-08, 1.6350e-04, 1.0265e-05],\n",
              "        [1.0000e+00, 1.0073e-11, 1.4615e-07, 1.2298e-10, 7.6690e-12, 1.4453e-09,\n",
              "         5.2474e-08, 2.1560e-10, 1.0604e-08, 1.4111e-08]],\n",
              "       grad_fn=<SoftmaxBackward>)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 154
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "-QOn05xtl3-P",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "samp = np.random.rand(28, 28)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "XgNJ-VjCmxBK",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "samp = torch.tensor([samp]).float()"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0Ps0wwKZnF7N",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 55
        },
        "outputId": "85f3839e-467d-4f86-9b35-230aa5464eaa"
      },
      "source": [
        "model(samp)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([[  0.9136,  -2.9917,   2.5369,   6.5700,  -7.8649,   5.9453,  -0.2111,\n",
              "         -10.1161,   6.6822,  -0.8494]], grad_fn=<AddmmBackward>)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 179
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Jr17bYkDnOAs",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "5a673db2-fdab-490f-dc20-06b497a5c1bb"
      },
      "source": [
        "images[0].dtype"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "dtype('float32')"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 180
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "YZPS6_ipnkhH",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 36
        },
        "outputId": "aa7e7655-3a63-4027-80b0-4673f92473d2"
      },
      "source": [
        "samp.dtype"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "torch.float32"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 181
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "S6DMfV8entAx",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 55
        },
        "outputId": "a0a76b21-f7ac-4547-e58e-2d1a3d4cac7e"
      },
      "source": [
        "model(images[0])"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "tensor([[ -0.1054,  -0.4415,   3.8608,   4.9196,  -6.9985,  -2.7122, -12.9888,\n",
              "          15.5207,  -2.3090,   3.3491]], grad_fn=<AddmmBackward>)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 160
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "IwNAq5b5nyj6",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "sTT3DFHyn1fk",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}